import java.util.regex.*;

public class Programa3{
	public static void main(String ... a){
		Pattern p = Pattern.compile("<[AaBbCcD]>");
		Matcher m = p.matcher("Mais importante e <A>m<B><a>r!");
		boolean b = false;
		System.out.println("Padrao: " + m.pattern());
		while( b = m.find())
		System.out.println(m.start() + " " + m.group());
	}
}